﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AjaxControlToolkit;

namespace SisEagle.View.Web.UserControl
{
    public partial class UcFormasPagamento : System.Web.UI.UserControl
    {
        #region Singleton
        private SisEagleBO.FormasPagamentosBO _FormasPagamentosBusiness;
        private SisEagleBO.FormasPagamentosBO FormasPagamentosBusiness
        {
            get
            {
                if (_FormasPagamentosBusiness == null)
                    _FormasPagamentosBusiness = new SisEagleBO.FormasPagamentosBO();

                return _FormasPagamentosBusiness;
            }
        }

        #endregion

        #region Controls
        private ComboBox cmbFormasPagamentos;
        #endregion

        #region Page-Load/OnInit
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            inicializeComponentes();
            carregaCombo();
        }

        private void carregaCombo()
        {

            ComboFormasPagamentos.DataSource = FormasPagamentosBusiness.FindAll(ComboFormasPagamentos.DataTextField);
            ComboFormasPagamentos.DataBind();

        }
        protected void Page_Load(object sender, EventArgs e)
        {


        }
        #endregion

        #region Binding


        public ComboBox ComboFormasPagamentos
        {
            get
            {


                return cmbFormasPagamentos;
            }
            set
            {

                cmbFormasPagamentos = value;
            }
        }


        #endregion

        #region finds
        private void inicializeComponentes()
        {
            cmbFormasPagamentos = FindControl("cmbFormasPagamento") as ComboBox;
        }
        #endregion
    }
}